namespace RPG.Domain.Character
{
    public class Stats : ValueObject
    {
        public int Strength { get; }
        public int Agility { get; }
        public int Intelligence { get; }
        public int Health { get; }
        public int Mana { get; }

        private Stats(int strength, int agility, int intelligence, int health, int mana)
        {
            Strength = strength;
            Agility = agility;
            Intelligence = intelligence;
            Health = health;
            Mana = mana;
        }

        public static Stats InitialStats()
        {
            return new Stats(10, 10, 10, 100, 100);
        }

        public static Stats CalculateForLevel(Level level)
        {
            var baseStats = InitialStats();
            var multiplier = 1 + (level.Value - 1) * 0.1f;
            
            return new Stats(
                (int)(baseStats.Strength * multiplier),
                (int)(baseStats.Agility * multiplier),
                (int)(baseStats.Intelligence * multiplier),
                (int)(baseStats.Health * multiplier),
                (int)(baseStats.Mana * multiplier)
            );
        }

        public Stats ApplyEquipmentBonus(Equipment equipment)
        {
            return new Stats(
                Strength + equipment.StrengthBonus,
                Agility + equipment.AgilityBonus,
                Intelligence + equipment.IntelligenceBonus,
                Health + equipment.HealthBonus,
                Mana + equipment.ManaBonus
            );
        }
    }
}
